package com.haoan.index.controller;

import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

import com.haoan.common.annotation.Anonymous;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.haoan.common.annotation.Log;
import com.haoan.common.core.controller.BaseController;
import com.haoan.common.core.domain.AjaxResult;
import com.haoan.common.enums.BusinessType;
import com.haoan.index.domain.LcTrends;
import com.haoan.index.service.LcTrendsService;
import com.haoan.common.utils.poi.ExcelUtil;
import com.haoan.common.core.page.TableDataInfo;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * 存储业内动态信息的Controller
 * 
 * @author autoGen
 * @date 2025-03-19
 */
@Api(value="存储业内动态信息",tags = "存储业内动态信息")
@RestController
@Anonymous
@RequestMapping("/index/lcTrends")
public class LcTrendsController extends BaseController
{
    @Resource
    private LcTrendsService lcTrendsService;

    /**
     * 查询存储业内动态信息的列表
     */
    @ApiOperation("查询存储业内动态信息的列表")
    @PreAuthorize("@ss.hasPermi('index:lcTrends:list')")
    @GetMapping("/list")
    public TableDataInfo list(LcTrends lcTrends)
    {
        startPage();
        List<LcTrends> list = lcTrendsService.selectLcTrendsList(lcTrends);
        return getDataTable(list);
    }

    /**
     * 导出存储业内动态信息的列表
     */
    @ApiOperation("导出存储业内动态信息的列表")
    @PreAuthorize("@ss.hasPermi('index:lcTrends:export')")
    @Log(title = "存储业内动态信息的", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, LcTrends lcTrends)
    {
        List<LcTrends> list = lcTrendsService.selectLcTrendsList(lcTrends);
        ExcelUtil<LcTrends> util = new ExcelUtil<LcTrends>(LcTrends.class);
        util.exportExcel(response, list, "存储业内动态信息的数据");
    }

    /**
     * 获取存储业内动态信息的详细信息
     */
    @ApiOperation("获取存储业内动态信息的详细信息")
    @PreAuthorize("@ss.hasPermi('index:lcTrends:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(lcTrendsService.selectLcTrendsById(id));
    }

    /**
     * 新增存储业内动态信息的
     */
    @ApiOperation("新增存储业内动态信息的")
    @PreAuthorize("@ss.hasPermi('index:lcTrends:add')")
    @Log(title = "存储业内动态信息的", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody LcTrends lcTrends)
    {
        return toAjax(lcTrendsService.insertLcTrends(lcTrends));
    }

    /**
     * 修改存储业内动态信息的
     */
    @ApiOperation("修改存储业内动态信息的")
    @PreAuthorize("@ss.hasPermi('index:lcTrends:edit')")
    @Log(title = "存储业内动态信息的", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody LcTrends lcTrends)
    {
        return toAjax(lcTrendsService.updateLcTrends(lcTrends));
    }

    /**
     * 删除存储业内动态信息的
     */
    @ApiOperation("删除存储业内动态信息的")
    @PreAuthorize("@ss.hasPermi('index:lcTrends:remove')")
    @Log(title = "存储业内动态信息的", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(lcTrendsService.deleteLcTrendsByIds(ids));
    }
}
